<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function findById(){
            let id = localStorage.getItem('userId')
            $.ajax({
                type: 'get',
                url: 'http://ums.tangxiaoyang.vip/api/user/findById',
                data: { id },
                dataType: 'json',
                success: function(res){
                    if(res.status === 200){
                        let user = res.data
                        $('#name').val(user.name)
                        $('#phone').val(user.phone)
                        $('#address').val(user.address)
                    }
                }
            })
        }

        $(function(){
            findById()
        })
    </script>
</head>
<body>
    <h2>修改用户</h2>
    姓名：<input type="text" id="name"> <br>
    电话：<input type="text" id="phone"> <br>
    地址：<input type="text" id="address">  <br>
    <button onclick="modify()">修改</button>
</body>
</html>